package com.zbkj.admin.controller.platform;

import com.zbkj.common.model.AiFittingRecord;
import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.AiFittingRecordSearchRequest;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.result.CommonResult;
import com.zbkj.service.service.AiFittingRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * ai试衣记录 前端控制器
 */
@Slf4j
@RestController
@RequestMapping("api/admin/platform/ai-fitting-record")
@Api(tags = "ai试衣记录")
public class AiFittingRecordController {

    @Autowired
    private AiFittingRecordService aiFittingRecordService;


    /**
     * 分页显示ai试衣记录
     *
     * @param request          搜索条件
     * @param pageParamRequest 分页参数
     * @author keNan
     * @since 2025-05-21
     */
    @ApiOperation(value = "分页列表")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public CommonResult<CommonPage<AiFittingRecord>> getList(@Validated AiFittingRecordSearchRequest request, @Validated PageParamRequest pageParamRequest) {
        CommonPage<AiFittingRecord> aiFittingRecordCommonPage = CommonPage.restPage(aiFittingRecordService.getList(request, pageParamRequest));
        return CommonResult.success(aiFittingRecordCommonPage);
    }


    /**
     * 查询ai试衣记录信息
     *
     * @param id Integer
     * @author keNan
     * @since 2025-05-21
     */
    @ApiOperation(value = "详情")
    @RequestMapping(value = "/info", method = RequestMethod.GET)
    public CommonResult<AiFittingRecord> info(@RequestParam(value = "id") Integer id) {
        AiFittingRecord aiFittingRecord = aiFittingRecordService.getById(id);
        return CommonResult.success(aiFittingRecord);
    }
}



